<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户信息</title>
<link href="${pageContext.request.contextPath}/admin/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.3.1.js"></script>

<script type="text/javascript">

//删除
function del(uid){
	if(!confirm("是否确认删除")){
		return;
	}
	location.href="${pageContext.request.contextPath}/loginServlet?method=deUser&uid="+uid;	
}
// old write 
$(document).ready(function(){
  $(".click").click(function(){
  $(".tip").fadeIn(200);
  });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});

});




</script>
</head>
<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">商品管理</a></li>
    </ul>
    </div>
  
    <div class="rightinfo">
    
    <div class="tools">
    
    	<ul class="toolbar">
        <li id="batchDelete" style="cursor: pointer;"><span><img src="${pageContext.request.contextPath}/admin/images/t03.png" /></span>批量删除</li>
        </ul>

    </div>
    <table class="tablelist">
    	<thead>
	    	<tr>
		        <th><input id="checkbox_main" type="checkbox" /></th>
		        <th>序号<i class="sort"><img src="${pageContext.request.contextPath}/admin/images/px.gif" /></i></th>
		        <th>姓名</th>
		        <th>性别</th>
		        <th>电话号码</th>
		        <th>所在地区</th>
		        <th>权限</th>
		        <th>账号</th>
		       	<th>头像</th>
		       	<th>操作</th>
	        </tr>
	    </thead>
        <tbody>
        	<c:if test="${not empty up.result }">
        		<c:forEach items="${up.result }" var="u" varStatus="vs">
	        		<tr>
				        <td><input name="ids" type="checkbox" value=""/></td>
				        <td>${vs.count }</td>
				        <td>${u.name }</td>
				        <td>
				        	<c:if test="${u.sex==1 }">男</c:if>
				        	<c:if test="${u.sex==2 }">女</c:if>
				        </td>
				        <td>${u.phone_number }</td>
				        <td>${u.area }</td>
				        <td>
				        	<c:if test="${u.manager==1 }">管理员</c:if>
				        	<c:if test="${u.manager==0 }">普通用户</c:if>
				        </td>
				        <td>${u.username }</td>
				       	<td style="text-align: center;">
				       		<img src="/xm_load/${u.photo }" width="80" height="50" alt="" />
				       	</td>
				       	<td>
				       	  <a href="javascript:void(0)" onclick="del(${u.uid})" >删除</a>
				       	</td>
			        </tr>
		        </c:forEach>
        	</c:if>
        </tbody>
    </table>
   
	<div class="pagin">
    	<div class="message">共<i class="blue">${up.totalRecord }</i>条记录，当前显示第&nbsp;<i class="blue">${up.pageNumber }&nbsp;</i>页</div>
        <ul class="paginList">
	        
	         <li class="paginItem"><a href="${pageContext.request.contextPath }/loginServlet?method=uquery&pageNumber=1" >首页</a></li>
	         
	         <c:if test="${up.pageNumber>1}">
	         <li class="paginItem"><a href="${pageContext.request.contextPath }/loginServlet?method=uquery&pageNumber=${up.pageNumber-1}" >上一页</a></li>
	         </c:if>
	        
	        
	         <c:if test="${up.pageNumber<up.totalPage}">
	         <li class="paginItem"><a href="${pageContext.request.contextPath }/loginServlet?method=uquery&pageNumber=${up.pageNumber+1}" >下一页</a></li>
	         </c:if>
	         
	         <li class="paginItem"><a href="${pageContext.request.contextPath }/loginServlet?method=uquery&pageNumber=${up.totalPage}" >尾页</a></li>
        </ul>
    </div> 
    
    
    <div class="tip">
    	<div class="tiptop"><span>提示信息</span><a></a></div>
        
      <div class="tipinfo">
        <span><img src="images/ticon.png" /></span>
        <div class="tipright">
        <p>是否确认对信息的修改 ？</p>
        <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
        </div>
        </div>
        
        <div class="tipbtn">
        <input name="" type="button"  class="sure" value="确定" />&nbsp;
        <input name="" type="button"  class="cancel" value="取消" />
        </div>
    
    </div>
    
    
    
    
    </div>
    
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	</script>
</body>
</html>
